package com.itsu.dao;

import com.itsu.domain.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

@Repository
public interface UserDao {

    @Select("select * from user where id = #{id}")
    User findById(Integer id);

    @Update("update user set money = money - #{money} where name = #{name}")
    void outMoney(@Param("name") String name, @Param("money") String money);

    @Insert("insert into log (log) value (#{log})")
    void printLog(String log);
}
